import http from '../utils/axios'; //引进http
// 基础路径

interface Type {
  userId?: number;
  userName?: string;
  userAccount?: string;
  userPhone?: string;
  regTime?: string;
  userBuyMoney?: number;
  status?: number | undefined;
}

// 获取用户列表数据
export const getUserList = (params?: any) => {
  return http.get<any>('/other/user/queryAll', params);
};

// 获取用户购买数据
// export const purchase =()
export const purchase = (params?: any) => {
  return http.get<any>('/other/buy/queryByBuy', params);
};

// 根据id获取户用详情数据 传参
interface DataType {
  code: string;
  data: {};
  msg: string;
}
export const getSearch = (params: Type) => {
  return http.get<any>('/other/user/queryMsg', params);
};
// 查询

export const inquire = (data: Type) =>
  http.post<any>('/other/user/queryCondition', data);
//  重置

// 删除接口
interface DelMsg {
  userId: number;
}

export const userDelete = (data: DelMsg | any) =>
  http.post<any>('/other/user/deleteUser', data);
//批量删除
export const batchDelete = (data: DelMsg | any) =>
  http.post<any>('/other/user/deleteUser', data);

// 用户状态
export const staTe = (data: any) =>
  http.post<any>('/other/user/updateStatus', data);
//修改用户
//  export const modification = (data:any)=>
//  http.post<any>(baseUrl+'/user/updateUser',data)
export const modification = (data: any) =>
  http.post<any>('/other/user/updateUser', data);
// 用户查询按照顺序
// 时间顺序
export const timeOrder = (params?: any) =>
  http.get<any>('/other/user/regTimeAsc', params);
// 时间倒序
export const timeinverted = (params?: any) =>
  http.get<any>('/other/user/regTimeDesc', params);
// 金额顺序
export const moneyOrder = (params?: any) =>
  http.get<any>('/other/user/moneyAsc', params);
// 金额倒序
export const moneyinverted = (params?: any) =>
  http.get<any>('/other/user/moneyDesc', params);

//  用户标签也接口
export const Usertags = (params?: any) =>
  http.get<any>('/other/tag/queryAll', params);

//  删除用户标签
export const cancel = (params?: any) =>
  http.get<any>('/other/tag/deleteLabel', params);
//编辑用户
export const modificationLabel = (data?: any) =>
  http.post<any>('/other/tag/updateTag', data);
// 添加用户标签
export const adduser = (data?: any) =>
  http.post<any>('/other/tag/saveTag', data);
